<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
    </div>
    <script>
        const newNode = document.createElement('li');
        //往父节点中插入子节点  也就是在子节点的链表尾部追加一个节点
        const bodyElement = document.querySelector('body');
        bodyElement.appendChild(newNode);
        //还可以在子节点的链表中任意位置 插入节点
        bodyElement.insertBefore(newNode.cloneNode(true),bodyElement.children[0]);
    </script>
</body>
</html>